<!-- 首页 -->
<template>
	<view class="page-container">
    <rhino-status-bar/>
    
    <u-form
      :model="formData"
      ref="form"
      label-width="150"
    >
      <u-form-item>
        <u-input 
          v-model="formData.content"
          type="textarea"
          maxlength="500"
          placeholder="想说点什么呢..."
        />
      </u-form-item>
      <u-form-item>
        <uni-file-picker
        	v-model="formData.imageList" 
        	fileMediatype="image" 
        	mode="grid" 
        	@success="handleUploadImageSuccess" 
        	@fail="handleUploadImageFail" 
        />
      </u-form-item>
      <u-form-item>
        <uni-data-checkbox
          v-model="formData.labelList"
          :localdata="labelList"
          multiple
        />
      </u-form-item>
      <u-form-item label="谁可以看">
        <rhino-selector
          v-model="formData.auth"
          :multiple="true"
          :list="relationshipList"
          label-key="label"
          value-key="value"
          placeholder="请选择"
          clearable
        />
      </u-form-item>
      <u-form-item label="关联课程">
        
      </u-form-item>
      <u-form-item label="关联活动">
      </u-form-item>
      <u-form-item label="记录时间">
        
      </u-form-item>
    </u-form>
	</view>
</template>

<script>
  export default {
    data() {
      return {
        labelList: [
          {
            text: '勇敢',
            value: 1
          },
          {
            text: '协作',
            value: 2
          }
        ],
        relationshipList: [
          {
            label: '父亲',
            value: 1
          },
          {
            label: '母亲',
            value: 2
          }
        ],
        formData: {
          content: null,
          imageList: [],
          labelList: [],
        },
      };
    },
    methods: {
      // 上传成功
      handleUploadImageSuccess(e){
      	console.log('上传成功')
      },
      
      // 上传失败
      handleUploadImageFail(e){
      	console.log('上传失败：',e)
      }
    }
  };
</script>

<style lang="scss" scoped>
  .page-container {
    height: 100vh;
    padding: 32rpx;
    background: #FFFFFF;
  }
</style>
